<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.

return array(
    'basePath'=>dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
    'name'=>'MAIN.RU',
    'sourceLanguage' => 'ru_ru',
    'language'=>'ru',

    // preloading 'log' component
    'preload'=>array('log'),

    // autoloading model and component classes
    'import'=>array(
        'application.models.*',
        'application.models.forms.*',
        'application.models.tests.*',
        'application.components.*',
        'application.common.*',
        'application.extensions.geoip.*',
    ),

    // controller map
    //'controllerMap'=>array(
    //),

    // modules
    //'modules' => array(
    //),

    // application components
    'components'=>array(
        'request' => array(
            'class' => 'api.components.CustomHttpRequest'
        ),
        // enables theme based JQueryUI's
        'widgetFactory' => array(
            'widgets' => array(
                'CJuiAccordion' => array(
                    'themeUrl' => '/css',
                    'theme' => 'rapidgator-theme',
                ),
                'CJuiAutoComplete' => array(
                    'themeUrl' => '/css',
                    'theme' => 'rapidgator-theme',
                ),
                'CJuiButton' => array(
                    'themeUrl' => '/css',
                    'theme' => 'rapidgator-theme',
                ),
                'CJuiDatePicker' => array(
                    'themeUrl' => '/css',
                    'theme' => 'rapidgator-theme',
                ),
                'CJuiDialog' => array(
                    'themeUrl' => '/css',
                    'theme' => 'rapidgator-theme',
                ),
                'CJuiDraggable' => array(
                    'themeUrl' => '/css',
                    'theme' => 'rapidgator-theme',
                ),
                'CJuiDroppable' => array(
                    'themeUrl' => '/css',
                    'theme' => 'rapidgator-theme',
                ),
                'CJuiInputWidget' => array(
                    'themeUrl' => '/css',
                    'theme' => 'rapidgator-theme',
                ),
                'CJuiProgressBar' => array(
                    'themeUrl' => '/css',
                    'theme' => 'rapidgator-theme',
                ),
                'CJuiResizable' => array(
                    'themeUrl' => '/css',
                    'theme' => 'rapidgator-theme',
                ),
                'CJuiSelectable' => array(
                    'themeUrl' => '/css',
                    'theme' => 'rapidgator-theme',
                ),
                'CJuiSlider' => array(
                    'themeUrl' => '/css',
                    'theme' => 'rapidgator-theme',
                ),
                'CJuiSliderInput' => array(
                    'themeUrl' => '/css',
                    'theme' => 'rapidgator-theme',
                ),
                'CJuiSortable' => array(
                    'themeUrl' => '/css',
                    'theme' => 'rapidgator-theme',
                ),
                'CJuiTabs' => array(
                    'themeUrl' => '/css',
                    'theme' => 'rapidgator-theme',
                ),
                'CJuiWidget' => array(
                    'themeUrl' => '/css',
                    'theme' => 'rapidgator-theme',
                ),
            ),
        ),
        'geoip' => array(
            'class' => 'application.extensions.geoip.CGeoIP',
            // specify filename location for the corresponding database
            'filename' => dirname(__FILE__) . '/../extensions/geoip/Base/GeoIP.dat',
            // Choose MEMORY_CACHE or STANDARD mode
            'mode' => 'STANDARD',
        ),
        /*'urlManager'=>array(
            'urlFormat'=>'path',
            'showScriptName'=>true,
            'rules'=>array(
                'file/<id:\d+>/<name>'=>'download/index',
                'file/<id:\d+>'=>'download/index',
                'ref/<ref:\d+>' => 'site/index',
            ),
        ),*/
        'user'=>array(
            'class'=>'WebUser',
            'cookieDomain' => '.main.ru',
            // enable cookie-based authentication
            //'allowAutoLogin'=>true,
        ),

        'db' => require($apiPath . 'config/localhost.php'),

        'errorHandler'=>array(
            // use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),

        'log'=>array(
            'class'=>'CLogRouter',
            'routes'=>array(
                // uncomment the following to show log messages on web pages
                /*
                array(
                    'class'=>'CWebLogRoute',
                ),
                */
            ),
        ),

        /*'cache'=>array(
            'class'=>'CMemCache',
            'useMemcached'=>false,
            'servers'=>array(
                array(
                    'host'=>'127.0.0.1',
                    'port'=>11211,
                    'weight'=>0,
                ),
            ),
        ),*/
    ),

    // application-level parameters that can be accessed
    // using Yii::app()->params['paramName']
    'params'=>array(
        // this is used in contact page
        'adminEmail' => 'admin@main.ru',
        'supportEmail' => 'support@main.ru',
        'robotEmail' => 'robot@main.ru',
        'cache_duration' => array(
            'key'=>60,
            'section'=>60,
            'action'=>60,
        ),
        'static_cache_duration' => 3600*24*365*10,
    ),
);
